package cn.jinhe.doc.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.jinhe.doc.base.DaoSupportImpl;
import cn.jinhe.doc.domain.Material;
import cn.jinhe.doc.domain.MaterialType;
import cn.jinhe.doc.service.MaterialService;
@Service
@Transactional
@SuppressWarnings("unchecked")
public class MaterialServiceImpl extends DaoSupportImpl<Material> implements MaterialService{

	@Override
	public List<Material> getByMaterialTypeId(MaterialType materialType) {
		// TODO Auto-generated method stub
		return getSession().createQuery(//
				"FROM Material m WHERE m.materialType=? ORDER BY m.name")//
				.setParameter(0, materialType)
				.list();
	}

	
	
}
